package com.mes.cloud.util;

import com.mes.cloud.threadlocal.UserInfoContext;
import com.mes.cloud.user.UserInfo;

/**
 * @Description TODO
 * @author: wxm
 * @date: 2020/6/2 12:52
 * @version: 1.0
 */
public class UserInfoUtil {

    public static String getEmpId(){
        UserInfo userInfo = UserInfoContext.getUserInfo();
        String empId = "";
        if(userInfo != null){
            empId = userInfo.getEmpId();
        }
        return empId;
    }

    public static String getPositionId(){
        UserInfo userInfo = UserInfoContext.getUserInfo();
        String positionId = "";
        if(userInfo != null){
            positionId = userInfo.getPositionId();
        }
        return positionId;
    }

    public static String getOrgId(){
        UserInfo userInfo = UserInfoContext.getUserInfo();
        String orgId = "";
        if(userInfo != null){
            orgId = userInfo.getOrganizationId();
        }
        return orgId;
    }

    public static String getOrgFamilyId(){
        UserInfo userInfo = UserInfoContext.getUserInfo();
        String orgFamilyId = "";
        if(userInfo != null){
            orgFamilyId = userInfo.getOrgFamilyId();
        }
        return orgFamilyId;
    }

}
